import Vue from "vue";
import VueI18n from "vue-i18n";
import enLocale from "./en.js";
import zhLocale from "./zh.js";

Vue.use(VueI18n);
let lang = uni.getLocale()
if(lang == 'zh-Hans'){
	lang = 'zh'
}
const value = uni.getStorageSync("language")
if (value) {
  lang = value
}
// let locale = zhCN;
// if (lang === "zh-CN") {
//   locale = zhCN;
// } else {
//   locale = enUS;
// }

const i18n = new VueI18n({
  locale: lang,
  messages: {
    "zh": zhLocale,
    "en": enLocale,
  },
});
 
export { i18n, lang };

